<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:forEach items="${trollList}" var="trollItem">
	<div class="newsListItem">
		<div class="listItemSeparator"></div>
		<div class="info" style="position: relative;">
			<h2>
				<a href="/photo/${trollItem.id}">${trollItem.title}</a>
			</h2>
			<div class="stats">
				<div class="viewComments">
					<span class="views" title="lượt xem"><fmt:formatNumber
							pattern="#,###,##0" value="${trollItem.viewNumber}" /></span> <span
						class="comments" title="lượt bình luận"><fmt:formatNumber
							pattern="#,###,##0" value="${trollItem.commentNumber}" /></span>
				</div>
			</div>
			<div class="uploader">
				Đăng bởi <a href="/uploader/${trollItem.uploader.id}">${trollItem.uploader.name}</a>
			</div>
		</div>

		<c:choose>
			<c:when test="${trollItem.url.lastIndexOf('.gif') != -1}">
				<div class="trollThumbnail hide">
			</c:when>
			<c:otherwise>
				<div class="trollThumbnail">
			</c:otherwise>
		</c:choose>
		<a href="/photo/${trollItem.id}"> <c:choose>
				<c:when test="${trollItem.sexy == 'Y'}">
					<img src="/resources/images/nhaycam.jpg" alt="${trollItem.title}"
						class="thumbImg">
				</c:when>
				<c:otherwise>
					<img src="/resources/data/photos/${trollItem.url}"
						alt="${trollItem.title}" class="thumbImg">
				</c:otherwise>
			</c:choose>
		</a>
	</div>
	<c:if test="${trollItem.url.lastIndexOf('.gif') != -1}">
		<div class="trollThumbnail gif-post">
			<c:choose>
				<c:when test="${trollItem.sexy == 'Y'}">
					<img class="thumbImg badge-item-img" src="/resources/images/nhaycam.jpg">
				</c:when>
				<c:otherwise>
					<img class="thumbImg badge-item-img"
						src="/resources/data/photos/${trollItem.url.replace('.gif','.jpg')}">
				</c:otherwise>
			</c:choose>
			<span class="play-gif">GIF</span>
		</div>
	</c:if>
	</div>
</c:forEach>